package com.dreamers.pathcore;

public class Vector2 {
    int x;
    int y;

    @Override
    public String toString() {
        return "Vector2{" +
                "x=" + x +
                ", y=" + y +
                '}';
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public Vector2(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public Vector2() {
    }

    public static float distance(Vector2 v1, Vector2 v2) {
        return Math.abs(v1.x - v2.x) + Math.abs(v1.y - v2.y);
    }

    public static void main(String[] args) {
        System.out.println(distance(new Vector2(3, 3), new Vector2(3, 4)));
        System.out.println(distance(new Vector2(3, 3), new Vector2(3, 3)));
    }
}
